package com.niit.web.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.niit.bean.Question;
import com.niit.service.QuestionService;
import com.niit.service.impl.QuestionServiceImpl;

@WebServlet("/RedirectGetQuestion")
public class ShowQuestionContentController extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String quesId = request.getParameter("quesId");
		QuestionService qs = new QuestionServiceImpl();
		Question question = qs.findByQuesId(quesId);
		request.setAttribute("question", question);
		request.getRequestDispatcher("/jsp/admin/load/them1detail.jsp").forward(request, response);
	}

}
